/* ------------------------------------------
*   Copyright (c) [2022] [R.H.Shen]
*   [SC4AC] is licensed under Mulan PSL v2.
*   You can use this software according to the terms and conditions of the Mulan
*   PSL v2.
*   You may obtain a copy of Mulan PSL v2 at:
*              http://license.coscl.org.cn/MulanPSL2
*   THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY
*	KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
*	NON-INFRINGEMENT, *	MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
*   See the Mulan PSL v2 for more details.
---------------------------------------------- */

#ifndef _LOG_H_
#define _LOG_H_

#include "switch.h"

using namespace std;
// the following are UBUNTU/LINUX ONLY terminal color codes.

#define RESET "\033[0m"
#define BLACK "\033[30m"              /* Black */
#define RED "\033[31m"                /* Red */
#define GREEN "\033[32m"              /* Green */
#define YELLOW "\033[33m"             /* Yellow */
#define BLUE "\033[34m"               /* Blue */
#define MAGENTA "\033[35m"            /* Magenta */
#define CYAN "\033[36m"               /* Cyan */
#define WHITE "\033[37m"              /* White */
#define BOLDBLACK "\033[1m\033[30m"   /* Bold Black */
#define BOLDRED "\033[1m\033[31m"     /* Bold Red */
#define BOLDGREEN "\033[1m\033[32m"   /* Bold Green */
#define BOLDYELLOW "\033[1m\033[33m"  /* Bold Yellow */
#define BOLDBLUE "\033[1m\033[34m"    /* Bold Blue */
#define BOLDMAGENTA "\033[1m\033[35m" /* Bold Magenta */
#define BOLDCYAN "\033[1m\033[36m"    /* Bold Cyan */
#define BOLDWHITE "\033[1m\033[37m"   /* Bold White */

// log 打印日志数据  数字为严重几倍, 1代表最高
#ifdef LOGERR
#define logerr(X) std::clog << BOLDRED << "log err-->  " << X << RESET << endl
#else
#define logerr(X) ;
#endif

#ifdef LOGBUG
#define logbug(X) std::clog << BOLDBLUE << "debug-->  " << X << RESET << endl
#else
#define logerr(X) ;
#endif

#ifdef LOGSTEP
#define logstep(X) \
  std::clog << BOLDYELLOW << "log step-->  " << X << RESET << endl
#else
#define logstep(X) ;
#endif

#ifdef LOGPROP
#define logprop(X) \
  std::clog << BOLDCYAN << "log prop-->  " << X << RESET << endl
#else
#define logprop(X) ;
#endif

#ifdef LOGRXMSG
#define logrxmsg(X) \
  std::clog << BOLDWHITE << "log rxmsg->  " << X << RESET << endl
#else
#define logrxmsg(X) ;
#endif

#ifdef LOGTXMSG
#define logtxmsg(X) \
  std::clog << BOLDWHITE << "log txmsg-->  " << X << RESET << endl
#else
#define logtxmsg(X) ;
#endif

#endif
